package com.exception;

public class ExceptionApiDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try {
            String string = "abc";
            System.out.println(Integer.parseInt(string));


        } catch (NumberFormatException e) {
            System.out.println("程序出错了");
            e.printStackTrace();
            String message = e.getMessage();//打印错误信息
            System.out.println("message = " + message);
        }
        System.out.println("程序结束了");

    }
}
